import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:search_people/utils/component/component.dart';
import 'package:search_people/utils/component/list/table_view.dart';

import 'index.dart';
import 'widgets/widgets.dart';

class DynamicPersonPage extends GetView<DynamicPersonController> {
  const DynamicPersonPage({Key? key}) : super(key: key);

  // 主视图
  Widget _buildView() {
    var state = controller.state;
    return TableView(
      header: PersonCardWidget(),
      data: state.list,
    );
  }

  @override
  Widget build(BuildContext context) {
    return GetBuilder<DynamicPersonController>(
      builder: (_) {
        return Scaffold(
          appBar: detailAppBar(
            context,
            title: '工作动态',
          ),
          body: SafeArea(
            child: _buildView(),
          ),
        );
      },
    );
  }
}
